package com.sunfeng.n3;


import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * @author sunfeng
 */

@Slf4j(topic = "c.Test7")
public class Test7 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread("t1") {
            @Override
            public void run() {
                try {
                    log.info("enter sleep .........." );
                    TimeUnit.SECONDS.sleep(2);

                } catch (InterruptedException e) {
                    log.info("wake up .........." );
                    e.printStackTrace();
                }
            }
        };
        t1.start();

        TimeUnit.SECONDS.sleep(1);
        log.info("interrupt.........." );
        t1.interrupt();



    }
}
